#ifndef THREAD_H
#define THREAD_H
#include <windows.h>

class mutex
{

  private:
  CRITICAL_SECTION cs;   // Windows' basic mutex object.

  public:
  void lock() {
    EnterCriticalSection(&cs);
  }

  void unlock() {
    LeaveCriticalSection(&cs);
  }

  mutex() {
    InitializeCriticalSection(&cs);
  }

  ~mutex() {
    DeleteCriticalSection(&cs);
  }

};

#endif
